//
//  DBManageController.h
//  MooreDoll
//
//  Created by 郭景豪 on 2015/1/2.
//  Copyright (c) 2015年 Tank. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "DBClass.h"
#import "FriendRoster.h"
#import "Room.h"
#import "GetNewToyDelegate.h"



@interface DBManageController : NSObject

@property (retain,nonatomic)DBClass *DB;

+(DBManageController *)sharedInstance;

-(NSArray *)getRoster;



-(NSArray *)coreDataSearchWithEntityName:(NSString *)entityName Predicate:(NSString *)predicateString sortDescriptor:(NSString *)sortString ascending:(BOOL)ascending;



-(void)setFriend:(NSArray *)friends;


-(void)getVcardResult:(NSDictionary *)vcardInfo;



-(void)changePresenceOnAndOffWithPresence:(BOOL)presence whoseJid:(NSString *)Jid;


-(void)whoseRoom:(NSString *)jid completionBlock:(void(^)(Room *room))completion failureBlock:(void(^)(BOOL noRoom))failureBlock;


@property (strong,nonatomic)NSMutableArray *vcardRequestArray;
@property (strong,nonatomic)NSMutableArray *vcardResultArray;


@property (nonatomic,weak)id<GetNewToyDelegate>getNewToyDelegate;

@end
